---
title: 'Knowledge Files'
section: 'tips'
tags: ['knowledge', 'documentation']
order: 4
---

# Knowledge Files

Codebuff uses knowledge files to store project-specific information and best practices. These files help Codebuff understand your project's context and requirements.

## Getting Started

You can ask Codebuff to create an initial knowledge file for your project:

```bash
    codebuff "Please create a knowledge.md file with initial project information"
```

Or create one manually:

1. Create a `knowledge.md` file at the root of your project:

```bash
    touch knowledge.md
```

2. For larger projects, you can optionally create additional knowledge files in subdirectories:

```bash
    touch backend/knowledge.md touch frontend/knowledge.md
```

This organization helps keep knowledge specific to different parts of your codebase close to the relevant code.

## What to Include

Knowledge files should contain information that isn't obvious from the code itself:

- Project goals and mission
- Technical decisions and their rationale
- Coding standards and best practices
- Common pitfalls to avoid
- Tips for working with project-specific tools
- Links to important documentation
- Build and deployment requirements
- Testing guidelines
- Verification commands to run after changes (e.g., `npm run build`, `npm run lint`, or `npm test`)

Don't worry about keeping knowledge files too short - they can grow to a couple hundred lines without impacting performance or cost. Focus on capturing useful information rather than minimizing file size.

## Post-Change Verification

You can specify commands that Codebuff should run after making changes to verify everything still works. For example:

```markdown
## Verifying Changes

After any code changes, run these commands to verify correctness:

- Run `npm run typecheck` to check for type errors
- Run `npm test` to ensure tests pass
```

When these commands are specified in a knowledge file, Codebuff will automatically run them after making changes to confirm the edits are valid.

Remember: Knowledge files should capture information that would be valuable for new team members or for refreshing your own memory after time away from the project.
